import request from "@/utils/request";
import { listVo } from "@/api/type";

const T = "/system";

export interface Request {
  /**
   * 备注
   */
  remark: string;
  /**
   * 状态
   */
  status: string;
  /**
   * 设备类型
   */
  type: string;
  [property: string]: any;
}

/**
 * 列表
 * @param {*} params
 * @returns
 */
export function GetListAPI(params: listVo) {
  return request({
    url: T + "/deviceType/list",
    method: "GET",
    params,
  });
}

/**
 * 新增
 * @param {*} data
 * @returns
 */
export function AddDataAPI(data: Request) {
  return request({
    url: T + "/deviceType",
    method: "POST",
    data,
  });
}

/**
 * 修改
 * @param {*} data
 * @returns
 */
export function EditDataAPI(data: Request) {
  return request({
    url: T + "/deviceType",
    method: "PUT",
    data,
  });
}

/**
 * 删除
 * @param id
 * @returns
 */
export function DelDataAPI(id: string) {
  return request({
    url: T + "/deviceType/remove/" + id,
    method: "DELETE",
  });
}

/**
 * 详情
 * @param id
 * @returns
 */
export function GetDetailsAPI(id: string) {
  return request({
    url: T + "/deviceType/view/" + id,
    method: "GET",
  });
}

/**
 * 修改设备类型状态
 * @param data
 * @returns
 */
export function UpdateStatusAPI(data: object) {
  return request({
    url: T + "/deviceType/updateStatus",
    method: "PUT",
    data,
  });
}
